package com.itheima.service;

import com.itheima.domain.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @author MI
 * @ClassName SmsService.java
 * @createTime 2021年11月23日 20:27:00
 */
@Slf4j
@Service
// consumerGroup 消费者组名 | topic主题名
@RocketMQMessageListener(consumerGroup = "shop-order", topic = "order-tipic")
public class SmsService implements RocketMQListener<Order> {
    //消费你逻辑
    @Override
    public void onMessage(Order message) {
        System.out.println("接受到了一个订单" + message);
    }
}
